package com.ybxx.core.command;

import org.hibernate.Criteria;
import org.hibernate.criterion.Example;
/**
 * 功能：HQE样例条件查询
 * 公司：XA.Co.LTD
 * 制作人：Tom.Y
 * 日期：2011-05*/
public class ExampleCommandImpl implements CriteriaCommand{
	private Object pojoExample = null;
	public void setPojoExample(Object pojoEx) {
		this.pojoExample = pojoEx;
	}
	public ExampleCommandImpl(Object pojoExample) {
		this.pojoExample = pojoExample;
	}
	public Criteria execute(Criteria criteria) {
		if (this.pojoExample != null) {
			Example exampleRestriction = Example.create(this.pojoExample);
			criteria.add(exampleRestriction);
		}
		return criteria;
	}
}
